
package code.codeworld.know.knowledge.model;


import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.Map;

/**
 * know实体
 *
 * @author freecode
 * @date 2023/03/23 00:20
 **/
@Getter
@Setter
@Entity
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
public class Know {

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NotNull
    private Long id;

    /**
     * 序号
     */
    private Integer sort;

    /**
     * 类型 Y
     */
    @NotNull
    private String type;

    /**
     * 子类型
     */
    private String subtype;

    /**
     * 标题 Y
     */
    private String title;

    /**
     * 来源
     */
    @Column(name = "`FROM`")
    @TableField("`FROM`")
    private String from;

    /**
     * 作者 Y
     */
    private String author;

    /**
     * 图片 以 / 符合分割保存 images
     */
    private String images;

    /**
     * 简介
     */
    private String blurb;

    /**
     * 类容 Y
     */
    private String content;

    /**
     * 拓展信息
     */
    private String extend;

    /**
     * 备注
     */
    private String remark;


    /**
     * 评论
     */
    @Column(name = "`COMMENT`")
    private String comment;

    /**
     * 字数 Y
     */
    private Integer wordage;

    /**
     * 星数
     */
    @Column(name = "STAR_NUM", length = 100)
    private Integer starNum;

    /**
     * 收藏数
     */
    @Column(name = "COLLECT_NUM", length = 100)
    private Integer collectNum;

    /**
     * 状态：0草稿 1审核 2驳回 3发布
     */
    private Integer states;

    /**
     * 审核结论
     */
    private String verdict;

    /**
     * 删除标志
     */
    @Column(name = "DELETE_FLAG", length = 2)
    private Integer deleteFlag;

    /**
     * 创建IP
     */
    @Column(name = "CREATE_IP")
    private String createIp;

    /**
     * 创建时间
     */
    //@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "CREATE_TIME")
    private Date createTime;

    /**
     * 创建用户
     */
    @Column(name = "CREATE_USER")
    private String createUser;

    /**
     * 修改IP
     */
    @Column(name = "UPDATE_IP")
    private String updateIp;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "UPDATE_TIME")
    private Date updateTime;

    /**
     * 修改用户
     */
    @Column(name = "UPDATE_USER")
    private String updateUser;

}

